home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
WINPROGS
/
UPC12BS2.ZIP
/
UTIL
/
UUPOLL.C
< prev
Wrap
C/C++ Source or Header
|
1993-09-26
|
38KB
|
1,026 lines
/*--------------------------------------------------------------------*/
/* Program: uupoll.c 22 September 1989 */
/* Author: Andrew H. Derbyshire */
/* Kendra Electronic Wonderworks */
/* P.O. Box 132 */
/* Arlington, MA 02174 */
/* Internet: help@kew.com */
/* Function: Performs autopoll functions for UUCICO */
/* Language: Borland C++ 3.1 */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* Changes Copyright (c) 1989-1993 by Kendra Electronic */
/* Wonderworks. */
/* */
/* All rights reserved except those explicitly granted by */
/* the UUPC/extended license agreement. */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* Usage: uupoll [-r 0] [-f hhmm] [-i hhmm|0400 ] */
/* [-d hhmm] [-e hhmm] */
/* [-a hhmm] [-x debug] [-s systems] */
/* [-c hhmm] [-C command] [-B command] */
/* */
/* Where: */
/* */
/* -r 0 specifies that UUCICO is to run */
/* into passive mode when waiting to */
/* poll out */
/* */
/* -r 1 specifies that UUCICO will not run */
/* in passive mode while waiting to */
/* poll out, but polling out will */
/* occur. */
/* */
/* -f hhmm is the first time in the day that */
/* UUCICO is to poll out. If omitted, */
/* polling begins after the interval */
/* specified with -i. */
/* */
/* -i hhmm the interval the UUCICO is to poll */
/* out at. If omitted, a period of 4 */
/* hours will be used. */
/* */
/* -d hhmm Terminate polling after hhmm. */
/* Default is not to terminate. */
/* */
/* -e hhmm Terminate polling at hhmm */
/* Default is not to terminate. */
/* */
/* -a hhmm Automatically poll actively using the */
/* system name "any" after any */
/* successful inbound poll if hhmm have */
/* past since last poll. hhmm may be */
/* 0000. */
/* */
/* -c hhmm Run a command at hhmm to clean the UUPC */
/* spool at this time every day. Default is */
/* never. */
/* */
/* -C cmd Run command 'cmd' at the specified by */
/* -c. The default is UUCLEAN. */
/* */
/* -B cmd Run command cmd before each active call */
/* out to batch up any work. Default is */
/* run nothing. */
/* */
/* In addition, the following flags will be passed */
/* to UUCICO: */
/* */
/* -s system system name to poll. By default, */
/* UUCICO will be invoked with */
/* '-s all' followed by '-s any'. */
/* */
/* -x n debug level. The default level */
/* is 1. */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* RCS Information */
/*--------------------------------------------------------------------*/
/*
* $Id: uupoll.c 1.14 1993/09/27 00:45:20 ahd Exp $
*
* $Log: uupoll.c $
* Revision 1.14 1993/09/27 00:45:20 ahd
* Make command syncs to get around bug in execute() under OS/2
*
* Revision 1.13 1993/09/20 04:41:54 ahd
* OS/2 2.x support
*
* Revision 1.12 1993/07/31 16:26:01 ahd
* Changes in support of Robert Denny's Windows support
*
* Revision 1.11 1993/07/19 02:52:11 ahd
* Up memory access room
*
* Revision 1.10 1993/06/06 15:04:05 ahd
* Allow for batch command to run before regularly scheduled poll out
*
* Revision 1.9 1993/05/13 01:39:04 ahd
* Additional fix for correctly handling UUCLEAN once and only once daily
*
* Revision 1.8 1993/05/11 03:25:17 ahd
* Don't loop when sleeping for autoclean -- get it over with
*
* Revision 1.7 1993/04/14 10:29:53 ahd
* Correct invalid exit time if both -e and -f flags specified
*
* Revision 1.6 1993/04/10 21:25:16 dmwatt
* Add Windows/NT support
*
* Revision 1.6 1993/04/10 21:25:16 dmwatt
* Add Windows/NT support
*
* Revision 1.5 1993/04/04 04:57:01 ahd
* Return exit code of UUCICO upon exit
*
* Revision 1.4 1993/03/06 23:04:54 ahd
* Add cr after auto-clean message
*
* Revision 1.3 1992/11/20 12:41:01 ahd
* Fix TZ change bug
*
* Revision 1.2 1992/11/15 04:45:46 ahd
* Correct polling for days time zone changes
*
* Revision 1.1 1992/11/15 04:29:22 ahd
* Initial revision
*
* Revision 1.1 1992/04/27 00:30:13 ahd
* Initial revision
*
*/
static const char rcsid[] =
"$Id: uupoll.c 1.14 1993/09/27 00:45:20 ahd Exp $";
/*--------------------------------------------------------------------*/
/* System include file */
/*--------------------------------------------------------------------*/
#include <ctype.h>
#include <dos.h>
#include <limits.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <conio.h>
#include <direct.h>
#include <signal.h> /* Ctrl-Break handler */
#if defined(WIN32) || defined(FAMILYAPI) || defined(_Windows) || defined(__OS2__)
#define NOCBREAK
#elif defined(__TURBOC__)
#include <alloc.h>
unsigned _stklen = 3172; /* R